<?php ob_start();?>
<!DOCTYPE html>
<html>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<?php
// include ($_SERVER['DOCUMENT_ROOT'].'/login/login-control.php');

// if (isset ( $_COOKIE ['GEVEZE_ADMIN'] )) {
// 	$db = connect ();
// 	$adminId = $_COOKIE ["GEVEZE_ADMIN"];
// 	$stmt = "SELECT *
// 			FROM ADMIN
// 			WHERE ID = $adminId";
// 	$res = $db->query ( $stmt ) or die ( $stmt . "<br/><br/>" . mysql_error () );
// 	if ( $row = $res->fetch_assoc ()) {
// 		goToMainPage();
// 	}
// 	$res->close ();
// 	disconnect ( $db );
// }


?>

<head>

<meta http-equiv="Content-Type" content="text/HTML; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Start Bootstrap - SB Admin Version 2.0 Demo</title>

<!-- Core CSS - Include with every page -->
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../font-awesome/css/font-awesome.css" rel="stylesheet">

<!-- SB Admin CSS - Include with every page -->
<link href="../css/sb-admin.css" rel="stylesheet">

<script
	src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"
	type="text/javascript"></script>

<script type="text/javascript">
    
    function login(){
    	var formData = $('#submitform').serialize();
    	$.ajax( {url: "login-control.php",
    			type: "POST",
    			data:  formData,
    			contentType: "application/x-www-form-urlencoded; charset=UTF-8",
    			success: function(data, textStatus, jqXHR)
    			{
    				$( "#wrongpass" ).html( data );
    			}});
    }
    
    function loginwithenter(e){
    	if (e.keyCode == 13) {
        	var formData = $('#submitform').serialize();
        	$.post("login-control.php",
        			formData,
        			function(data, textStatus, jqXHR)
        			{
        				$( "#wrongpass" ).html( data );
        			}).fail(function(jqXHR, textStatus, errorThrown) 
        			{
        			});
    	}
    }
    
    function clearmore(){
    	document.getElementById("wrongpass").innerHTML="";
    }
    </script>

</head>

<body>

	<div class="container">
		<div class="row">
			<div class="col-md-4 col-md-offset-4">
				<div class="login-panel panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title">Geveze Cafe</h3>
					</div>
					<div class="panel-body">
						<form id="submitform" role="form" action="login-control.php"
							method="post">
							<fieldset>
								<div class="form-group">
									<input onkeydown="clearmore()" class="form-control"
										placeholder="Kullanıcı Adı" name="username" type="text"
										autofocus>
								</div>
								<div class="form-group">
									<input onkeypress="loginwithenter(event)" class="form-control"
										placeholder="Şifre" name="password" type="password" value="">
								</div>
								<div class="checkbox">
									<label> <input name="remember" type="checkbox"
										value="hatirladi">Beni Hatırla
									</label> <b id="wrongpass" style="color: red;"></b>
								</div>
								<!-- Change this to a button or input when using this as a form -->
								<a onclick="login()" class="btn btn-lg btn-success btn-block">Giriş</a>
							</fieldset>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>

	<!-- Core Scripts - Include with every page -->
	<script src="../js/jquery-1.10.2.js"></script>
	<script src="../js/bootstrap.min.js"></script>
	<script src="../js/plugins/metisMenu/jquery.metisMenu.js"></script>

	<!-- SB Admin Scripts - Include with every page -->
	<script src="../js/sb-admin.js"></script>

</body>

</html>
<?php ob_end_flush(); ?>
